<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数组方法 </title>
</head>
<body>
<h2>删除元素-delete</h2>
<p>删除元素会在数组中留下未定义的孔。</p>

<p id="demo1"></p>
<p id="demo2"></p>

<script>
  var fruits = ["Banana", "Orange", "Apple", "Mango"];
  document.getElementById("demo1").innerHTML =
          "第一种水果是：" + fruits[0];
  delete fruits[0];
  document.getElementById("demo2").innerHTML =
          "第一种水果是：" + fruits[0];
</script>
</body>
</html>


<!--
运行结果：
第一种水果是：Banana
第一种水果是：undefined
-->